import { createRouter, createWebHashHistory } from 'vue-router'
import check from '../views/check'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/home/index'),
    children: [
      {
        path: '/recommend',
        name: 'Recommend',
        component: () => import('../views/recommend/index'),
        meta: {
          title: '推荐',
          keepAlive: true,
        },
      },
      {
        path: '/singers',
        name: 'Singers',
        component: () => import('../views/singers/index'),
        meta: {
          title: '歌手',
          keepAlive: true,
        },
      },
      {
        path: '/rank',
        name: 'Rank',
        component: () => import('../views/rank/index'),
        meta: {
          title: '排行',
          keepAlive: true,
        },
      },
      {
        path: '/singer',
        name: 'Singer',
        component: () => import('../views/singer/index'),
        meta: {
          proHeaderClose: true,
        }
      },
      {
        path: '/search',
        name: 'Search',
        component: () => import('../views/search/index'),
        meta: {
          proHeaderClose: true,
          title: '使命搜索中',
        }
      }
    ],
  },
  {
    path: '/check',
    name: 'Check',
    component: check
  }
];

const router = createRouter({
  history: createWebHashHistory(),
  routes
});

export default router
